public class Solution {
/*计算机底层就是用的二进制所以不需熬转化*/
    public int hammingWeight(int n) {
        int count = 0;
        while (n != 0) {
            count += n & 1;
            n >>>= 1;
        }
        return count; // 注意一下》》》表示一直补零
    }

    public int hammingWeight2(int n) {
        int count = 0;
        while (n != 0) {
            n &= n - 1;
            count++;
        }
        return count;
    }


}
